package de.slackspace.keycloaktutorial.security.web.config;

import java.util.List;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import de.slackspace.keycloaktutorial.security.web.resolver.UserDetailsArgumentResolver;

@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {

	@Override
	public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
		argumentResolvers.add(createUserDetailsResolver());
	}

	@Bean
	public UserDetailsArgumentResolver createUserDetailsResolver() {
		return new UserDetailsArgumentResolver();
	}
}
